package com.atguigu.chapter02

object TestVar {

  def main(args: Array[String]): Unit = {
    var age =18
    age = 19
//    age = "tom"
//    var name

    var num1 = 10
    val num2 = 20
//    num2 = 100
    num1 = 30

    var p1 = new Person()
    p1.name = "dalang"
    p1 = null

    val p2 = new Person()
    p2.name="jinlian"
//    p2=null
  }
}

class Person{
    var name : String = "jinlian"
}
